package com.zy.batiya.mapper;

import java.util.List;

import org.apache.ibatis.annotations.Param;

import com.zy.batiya.domain.User;

public interface UserMapper {
	
	public List<User> findByName(String name)throws Exception;
	
	public List<User> findAll()throws Exception;
	
	/**
	 * @param User
	 * @return Integer
	 */
	public Integer save(User obj);
	
	/**
	 * @param Integer 用户id
	 * @return User
	 */
	public User findById(@Param("id")Integer id);
		
	/**
	 * @param String
	 * @param String
	 * @return User
	 */
	public User findByUnameAndPwd(@Param("name")String username,@Param("password")String password);
	
	/**
	 * 根据用户名返回list
	 * */
	public List<User> getUsersByName(@Param("name")String userName, @Param("start")Integer start, @Param("length")Integer length, @Param("columnName")String columnName, @Param("orderDir")String orderDir);
	
	public Integer getUsersPageCountByName(@Param("name")String userName);
	
	public Integer verifyPassWord(@Param("name")String userName, @Param("passWord")String passWord);
	
	public Integer updatePassWord(@Param("id")Integer id, @Param("passWord")String passWord);
	
	public Integer updateUser(User obj);
	
	public Integer deleteUserById(@Param("id")Integer id);
	

}
